<template>
  <el-dialog v-model="isShow" :destroy-on-close="true" width="500" title="视频预览">
    <div><play ref="playerRef"></play></div>
  </el-dialog>
</template>

<script setup lang="ts">
import { nextTick, ref } from "vue";
import play from "./play.vue";
const isShow = ref(false);

const playerRef = ref<InstanceType<typeof play> | null>();

const acceptParams = (data: { url: string; cover: string }) => {
  isShow.value = true;
  nextTick(() => {
    playerRef.value?.changePlayer({ ...data });
  });
};

defineExpose({
  acceptParams
});
</script>

<style></style>
